//
//  MBToastC.m
//  UniverseProject
//
//  Created by king on 2021/6/23.
//  Copyright © 2021 Cloud2209. All rights reserved.
//
#import "MBProgressHUD+LG.h"
#import "MBProgressHUD+JDragon.h"
#import "MBToastC.h"

@interface MBToastC ()

@end

@implementation MBToastC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSInteger col = 3;
    CGFloat startX = 0;
    CGFloat startY = 0;
    CGFloat padding = 15;
    CGFloat itemWH = (K_SCREEN_WIDTH - padding * (col + 1)) / col;
    
    for (int i = 0; i < 20; i ++) {
        startX = i % col * itemWH + padding * (i  % col + 1);
        startY = (i / col) * itemWH + padding * (i / col + 1) + k_SafeAreaTopHeight;
        UIView *boxView = [[UIView alloc] initWithFrame:CGRectMake(startX, startY, itemWH, itemWH)];
        boxView.tag = i;
        boxView.backgroundColor = RandomColor;
        [boxView addTarget:self action:@selector(tapClick:)];
        [self.view addSubview:boxView];
    }
    
    
}



- (void)tapClick:(UITapGestureRecognizer *)ges{
    
    switch (ges.view.tag) {
        case 0:
        {
            [MBProgressHUD showTipMessageInWindow:@"信息已提交"];
        }
            break;
        case 1:{
            [MBProgressHUD showActivityMessageInWindow:@"加载中..."];
            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
                //n秒后追加任务代码到主队列，并开始执行
                //打印当前线程
//                NSLog(@"after---%@",[NSThread currentThread]);
                [MBProgressHUD hideHUD];
            });
        }
            break;
        case 2:{
                [MBProgressHUD showTipMessageInWindow:@"这儿呢这儿呢这儿呢这儿呢这儿呢这儿呢这儿呢这儿呢这儿呢这儿呢这儿呢这儿呢"];
        }
            break;
        case 3:{
           
        }
            break;
        case 4:{
            
        }
            break;
        case 5:{
           
        }
            break;
            
        case 6:{
            
        }
            break;
        case 7:{
           
        }
            break;
        case 8:{
            
        }
            break;
        default:
            
            break;
    }
    
}


@end
